package javase.ch03.pool.common;

import java.time.LocalDateTime;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit;

public class NewScheduledThreadPoolDemo {
    public static void main(String[] args) {
        ScheduledExecutorService pool = Executors.newScheduledThreadPool(1);

        pool.scheduleAtFixedRate(
                ()-> System.out.println(LocalDateTime.now()),
                1000,
                1000,
                TimeUnit.MILLISECONDS
        );

       // pool.shutdown();
    }
}
